
@extends ('layouts/app')

@section('content')
    <div class="prepaid">
        <div class="weui-cells  recharge">
            <div class="weui-cell">
                <div class="weui-cell__hd">
                    <label class="weui-label_kh">卡号</label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input_k" name="number"   maxlength="19" placeholder="请输入传充值卡号">
                </div>
            </div>
            <div class="weui-cell ">
                <div class="weui-cell__hd">
                    <label class="weui-label_kh">密码</label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input_k" name="password" type="tel" placeholder="请输入密码">
                </div>
            </div>
        </div>
    </div>
    <div class="prepaid_a">
    <a href="javascript:;" class="weui-btn weui-btn_primary open-popup">确认充值</a>
    </div>
    <script>
        var id = getRequest().id;
           $(".open-popup").click(function(){
              var data ={};
               //卡号
               data ['number']=$("input[name='number']").val();
               //密码
               data ['password']=$("input[name='password']").val();
               $.post("../api/cardCharge",data,function(res){
                   console.log("res",res);
                   if(typeof res === 'string'){
                       res = JSON.parse(res);
                   }
                   $.alert(res.info);
                   if(res.code ===200){

                       history.go(-1);

                   }
               })
           });

    </script>
@endsection


